﻿<%@ Page Language="C#" MasterPageFile="~/Web/Master/MasterPage.master" AutoEventWireup="true" CodeFile="Order.aspx.cs" Inherits="Web_Order" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="container">
        <h2>
            <strong style="margin: 2%;">我的订单</strong><small><asp:Label ID="EmptyInfo" runat="server" Text=""></asp:Label></small>
        </h2>
        <hr class="bg-info">
        <div id="page_cart" class="card">
            <table class="table table-hover text-center">
                <tbody>
                    <%=OrderInfor %>
                </tbody>
            </table>
            
            <asp:TextBox ID="TextOrderId" runat="server" Style="display:none" ></asp:TextBox>
            <asp:TextBox ID="OrderState" runat="server" Style="display:none" ></asp:TextBox>
            <asp:Button ID="BtnUpdate" runat="server" Style="display:none" Onclick="BtnUpdate_Click"/>
            <br />
        </div>
    </div>

    <script type="text/javascript">
        $(function () {
            $(".orderstate").each(function () {
                var state = $(this).val();
                //alert(state);
                if (state == 2) {
                    $(this).val("取消订单");
                } else if  (state == 3) {
                    $(this).val("确认收货");
                } else {
                    $(this).val("删除订单");
                }
            });

            $(".orderstate").click(function () {
                var btnInfo = $(this).val();
                alert(btnInfo);
                var orderId = $(this).prev().html();

                $(<%=OrderState.ClientID%>).val(btnInfo);
                $(<%=TextOrderId.ClientID%>).val(orderId);

                $(<%=BtnUpdate.ClientID%>).click();
            });
        })
    </script>

</asp:Content>

